package org.example.outputformat;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * @ClassName LogReducer
 * @Author 小坏
 * @Date 2021/7/23、10:55
 * @Version 1.0
 */
public class LogReducer extends Reducer<Text, NullWritable, Text, NullWritable> {
    @Override
    protected void reduce(Text key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {
        /**
         *         进来是这中数据格式
         *          http://www.baidu.com
         *         http://www.google.com
         *
         *         //防止有相同数据、丢数据 、做循环
         */

        for (NullWritable value : values) {
            context.write(key, NullWritable.get());
        }
    }

}
